
<!DOCTYPE html>
<%@page import="java.util.Date"%>
<%@page import="com.google.appengine.api.datastore.Entity"%>
<%@page import="com.blindnetworking.MailUtil"%>
<%@page import="com.blindnetworking.DBUtil"%>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Blind Dating | Networking Oportunities</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Le styles -->
    <link href="../assets/css/bootstrap.css" rel="stylesheet">
    <style type="text/css">
      body {
        padding-top: 40px;
        padding-bottom: 40px;
        background-color: #f5f5f5;
      }

      .form-signin {
        max-width: 500px;
        padding: 19px 29px 29px;
        margin: 0 auto 20px;
        background-color: #fff;
        border: 1px solid #e5e5e5;
        -webkit-border-radius: 5px;
           -moz-border-radius: 5px;
                border-radius: 5px;
        -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
           -moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
                box-shadow: 0 1px 2px rgba(0,0,0,.05);
      }
      .form-signin .form-signin-heading,
      .form-signin .checkbox {
        margin-bottom: 10px;
      }
      .form-signin input[type="text"],
      .form-signin input[type="password"] {
        font-size: 16px;
        height: auto;
        margin-bottom: 15px;
        padding: 7px 9px;
      }

    </style>
    <link href="../assets/css/bootstrap-responsive.css" rel="stylesheet">

    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="../assets/js/html5shiv.js"></script>
    <![endif]-->

    <!-- Fav and touch icons -->
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="../assets/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="../assets/ico/apple-touch-icon-114-precomposed.png">
      <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../assets/ico/apple-touch-icon-72-precomposed.png">
                    <link rel="apple-touch-icon-precomposed" href="../assets/ico/apple-touch-icon-57-precomposed.png">
                                   <link rel="shortcut icon" href="../assets/ico/favicon.ico">
  </head>

  <body>

	<div style="text-align: center; width: 100%;">
		<img src="../assets/img/osn.png" alt=""/>
		<h1 id="title">Blind Networking</h1> 
		<h3>@devfestportugal</h3>
		<p style="font-size: 18px;">A new concept of networking.</p>
	</div>

<%
	Entity meeting = (Entity)request.getAttribute("meeting");
	String type = (String)request.getAttribute("type");

	String key = request.getParameter("key");
	
	String msg = null;
	boolean error = false;
	
	
	String unexpected = "There was an unexpected error and that's our fault. Please try again and report this error to help us improve this service.";
	
	if (type.equals("error")){
		msg = unexpected;
		error = true;
	}else if (type.equals("notChanged")){
		if (meeting == null){
			msg = "We could not find this meeting in our database.";
		}else if (DBUtil.eq(meeting, "state", "done"))
			msg = "This Blind Date is already confirmed.";
		else if (DBUtil.eq(meeting, "state", "declined")){
			msg = "This meeting is already canceled.";
		}else
			msg = unexpected;
	
		error = true;
	}else if (type.equals("accepted")){
		msg = "You have ACCEPTED this Blind Date.";
		error = false;
	}else if (type.equals("declined")){
		msg = "You have DECLINED this Blind Date.";
		error = false;
	}

%>

<% if (msg != null){ %>
	<div class="alert alert-<%= error?"error":"success" %>" style="width: 400px; margin: 0 auto; margin-top: 40px;text-align:center;"> <%= msg %> </div>
<% } %>

<% if (meeting != null){ 
	Entity me = null;
	Entity other = null;

	if (DBUtil.eq(meeting, "user1ConfirmKey", key)){
		me = DBUtil.getUser1(meeting);
		other = DBUtil.getUser2(meeting);
	}else{
		me = DBUtil.getUser2(meeting);
		other = DBUtil.getUser1(meeting);
	}
	
%>
<div class="form-signin" style="width: 400px; margin: 0 auto; margin-top: 20px;">

	<h4 style="margin-bottom:30px;">Enjoy your Networking!</h4>

	<ul style="list-style: none;">
		<li>
			<p>
				<span class="icon-arrow-right"></span> 
				Your partner name: <strong><%= other.getProperty("name") %></strong>
			</p>
		</li>
		<li>
			<p>
				<span class="icon-arrow-right"></span>
				<% 
					String date = DBUtil.formatDate((Date)meeting.getProperty("meetingDate")); 
				%> 
				Date: <strong><%= date %></strong>
			</p>
		</li>
		<li>
			<p>
				<span class="icon-arrow-right"></span> 
				Location: <strong><%= meeting.getProperty("venue") %></strong>
			</p>
		</li>
		<li>
			<p>
				<span class="icon-arrow-right"></span> 
				Look for someone wearing: <strong><%= other.getProperty("wear") %></strong>
			</p>
		</li>
		<li>
			<p>
				<span class="icon-arrow-right"></span> 
				Conversation starter: <strong><%= meeting.getProperty("starter") %></strong>
			</p>
		</li>
	</ul>
	
	<div style="margin-top:30px;">
		<p >Please show up and don't be late to your meeting.</p>
	</div>
</div>
<% } %>


    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="../assets/js/jquery.js"></script>
    <script src="../assets/js/bootstrap.min.js"></script>

  </body>
</html>
